package net.uiiang.android.BiscuitBoxDemo.text.style;

import net.uiiang.android.BiscuitBox.R;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.TextView;

public class TextShadow extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /*
         * 在style.xml文件中设定阴影效果
         * style.xml文件内容 
         * <style name="textShadowInStyle_xml"> 
         * <item name="android:paddingLeft">4px</item> 
         * <item name="android:paddingBottom">4px</item> 
         * <item name="android:textColor">#00FF00</item> 
         * <item name="android:textSize">24sp</item> 
         * <item name="android:typeface">monospace</item> 
         * <item name="android:shadowColor">#FE2E2E</item> 
         * <item name="android:shadowDx">9</item> 
         * <item name="android:shadowDy">7</item> 
         * <item name="android:shadowRadius">6</item> 
         * </style>
         */
        super.setContentView(R.layout.text_shadow);
        
        // 在代码中设定阴影效果
        TextView textViewShadow = (TextView)super.findViewById(R.id.shadowInCode);
        textViewShadow.setTextSize(24);
        textViewShadow.setShadowLayer(6, 9, 7, Color.BLUE);
    }
}
